<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

    <script>
        //输入一个参数，输出平方，输入两个参数，输出和
        function a(){
            if(arguments.length == 1){
                console.log(arguments[0]*arguments[0])
            }else if(arguments.length == 2){
                console.log(arguments[0]+arguments[1])
            }
        }

        //输入一个参数：为字符串or数字
        //输入两个参数：求和
        function b(){
            if(arguments.length == 1){
                if(typeof(arguments[0])=='string'){
                    console.log('你好'+arguments[0])
                }
                else{
                console.log(arguments[0]*arguments[0])
                }
            }else if(arguments.length == 2){
                console.log(arguments[0]+arguments[1])
            }
        }

    </script>
</body>
</html>
